package com.example.kotlin.activity

import android.content.Intent
import android.os.Bundle
import android.widget.Toast
import com.example.kotlin.R
import kotlinx.android.synthetic.main.activity_login.accountEdit
import kotlinx.android.synthetic.main.activity_login.login
import kotlinx.android.synthetic.main.activity_login.passwordEdit

class LoginActivity : BaseActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_login)

        login.setOnClickListener {
            val account=accountEdit.text.toString()
            val password = passwordEdit.text.toString()
            if (account=="admin" && password=="123456"){
                val intent=Intent(this, FirstActivity::class.java)
                startActivity(intent)
                finish()
            }else{
                Toast.makeText(this,"账号密码错误",Toast.LENGTH_SHORT).show()
            }
        }
    }
}